import { useEffect } from "react";
import { useLocation } from "react-router-dom";

/**
 * 路由变化时触发
 */
export const useSubsciberRouter = (cb: (pathname: string) => void) => {
  const location = useLocation();
  useEffect(() => {
    cb(location.pathname)
  }, [location.pathname]);
};
